package org.september.pisces.module.api;

import java.util.HashMap;
import java.util.Map;

public class WebMenu {

	/**
	 * 格式：一级菜单-二级菜单
	 */
	private String text;
	
	private String url;
	/**
	 * 菜单图标的css class
	 * TODO 如何管理各自的icon class.
	 */
	private String iconClass;
	
	private Map<String,String[]> perminssionMap = new HashMap<>();
	
	public WebMenu(String text, String url, String iconClass) {
		super();
		this.text = text;
		this.url = url;
		this.iconClass = iconClass;
	}
	
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getIconClass() {
		return iconClass;
	}
	public void setIconClass(String iconClass) {
		this.iconClass = iconClass;
	}
	
	public WebMenu addPermission(String name , String[] urls) {
		perminssionMap.put(name, urls);
		return this;
	}

	public Map<String, String[]> getPerminssionMap() {
		return perminssionMap;
	}
	
}
